import { createApp } from 'vue';
import App from './App.vue';
import { i18n } from './i18n';
import useElementPlus from './plugins/useVant';
import router from './router';
import store from './store';
import autoReisterGlobal from './registerGlobal';
import ServerLang from '@/util/ServerLang';
import NccloudMqtt from 'nccloud-mqtt';
import useRouterDefender from '@/router/defender';
import { loadScript } from './util/map.config';
import './style/base.scss';
import './assets/iconfont/iconfont.css';
import '@/font/iconfont';
import '@/font/iconfont_al';

loadScript(() => {
    const app = createApp(App);

    if (process.env.NODE_ENV === 'development') {
        app.config.devtools = true;
    } else {
        app.config.devtools = false;
    }
    useElementPlus(app);
    autoReisterGlobal(app);
    useRouterDefender(router, store);
    app.use(NccloudMqtt, {});
    app.use(i18n);
    app.use(ServerLang);
    app.use(store).use(router).mount('#app');
});
